/**
 * 
 */
package com.jie.eclipse.pan.gef.action;

import org.eclipse.jface.action.Action;

import com.jie.eclipse.pan.dao.QMDao;
import com.jie.eclipse.pan.editors.utils.PanImageHelper;
import com.jie.eclipse.pan.utils.gef.PaletteFactory;
import com.jie.eclipse.pan.views.PanDeveloperhelperView;

/**
 * @author yanjie
 *
 */
public class RefreshAction extends Action{
	private PanDeveloperhelperView helperview = null; 
	/**
	 * 
	 */
	public RefreshAction(PanDeveloperhelperView helperview) {
		this.helperview = helperview;
		this.setText("刷新");
		this.setToolTipText("刷新");
		this.setImageDescriptor(PanImageHelper.getInstance().getImageDescriptor("icons/refresh.gif"));
		//refresh.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
	}
	
	@Override
	public void run() {
		QMDao.getInstance().Refresh();
		this.helperview.getViewer().setPaletteRoot(PaletteFactory.getInstance().createPalette());
	}
}
